package com.by.controller;

import com.by.bean.ErpPurchaseOrderOtherClauses;
import com.by.bean.ResultBean;
import com.by.group.V;
import com.by.mapper.ErpPurchaseOrderOtherClausesMapper;
import com.by.utils.Assert;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :LYJ
 * @version : 1.0
 * @date : 2025/3/7 20:08
 * @desc : 采购订单表-其他信息表
 * @since : JDK17
 */
@RestController
@RequestMapping("/api")
@Api(tags = "采购订单表-其他信息表")
public class ErpPurchaseOrderOtherClausesController extends BaseController {
    @Autowired
    ErpPurchaseOrderOtherClausesMapper erpPurchaseOrderOtherClausesMapper;

    @PostMapping("/supplier/otherClausesSave")
    @ApiOperation("采购订单表-其他信息表-保存")
    public ResultBean save(@RequestBody @Validated ErpPurchaseOrderOtherClauses erpPurchaseOrderOtherClauses, BindingResult result) {
        V.validate(result);
        int res = erpPurchaseOrderOtherClausesMapper.save(erpPurchaseOrderOtherClauses);
        Assert.isZero(res, "添加信息失败");
        return success("success", erpPurchaseOrderOtherClauses);
    }
}
